 /* Copyright 2018 JDCLOUD.COM

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http:#www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.





Contact: 

NOTE: This class is auto generated by the jdcloud code generator program.
*/


#import <Foundation/Foundation.h>
#import <JDCloudOCSDKRenewal/RenewalModel.h>

@implementation RelationResource
-(id) initWithAppCode:(NSString*) appCode
      serviceCode:(NSString*)serviceCode
      resourceId:(NSString*)resourceId
      resourceName:(NSString*)resourceName
      region:(NSString*)region
      billingType:(NSString*)billingType
      expireTime:(NSString*)expireTime
      lastTime:(NSNumber*)lastTime
      autoRenewStatus:(NSString*)autoRenewStatus
      extendField:(NSString*)extendField { 
     self.appCode = appCode;               
     self.serviceCode = serviceCode;               
     self.resourceId = resourceId;               
     self.resourceName = resourceName;               
     self.region = region;               
     self.billingType = billingType;               
     self.expireTime = expireTime;               
     self.lastTime = lastTime;               
     self.autoRenewStatus = autoRenewStatus;               
     self.extendField = extendField;               
    return self;
}

-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self appCode])
    {
        [result setValue:[self appCode] forKey:@"appCode"];
    }
    if([self serviceCode])
    {
        [result setValue:[self serviceCode] forKey:@"serviceCode"];
    }
    if([self resourceId])
    {
        [result setValue:[self resourceId] forKey:@"resourceId"];
    }
    if([self resourceName])
    {
        [result setValue:[self resourceName] forKey:@"resourceName"];
    }
    if([self region])
    {
        [result setValue:[self region] forKey:@"region"];
    }
    if([self billingType])
    {
        [result setValue:[self billingType] forKey:@"billingType"];
    }
    if([self expireTime])
    {
        [result setValue:[self expireTime] forKey:@"expireTime"];
    }
    if([self lastTime])
    {
        [result setValue:[self lastTime] forKey:@"lastTime"];
    }
    if([self autoRenewStatus])
    {
        [result setValue:[self autoRenewStatus] forKey:@"autoRenewStatus"];
    }
    if([self extendField])
    {
        [result setValue:[self extendField] forKey:@"extendField"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.appCode = [dictionary objectForKey:@"appCode"];
    self.serviceCode = [dictionary objectForKey:@"serviceCode"];
    self.resourceId = [dictionary objectForKey:@"resourceId"];
    self.resourceName = [dictionary objectForKey:@"resourceName"];
    self.region = [dictionary objectForKey:@"region"];
    self.billingType = [dictionary objectForKey:@"billingType"];
    self.expireTime = [dictionary objectForKey:@"expireTime"];
    self.lastTime = [dictionary objectForKey:@"lastTime"];
    self.autoRenewStatus = [dictionary objectForKey:@"autoRenewStatus"];
    self.extendField = [dictionary objectForKey:@"extendField"];
    return self;
}
 @end
@implementation SetExpiredRenewParam
-(id) initWithAppCode:(NSString*) appCode
      serviceCode:(NSString*)serviceCode
      region:(NSString*)region
      resourceIds:(NSString*)resourceIds
      renewStatus:(NSString*)renewStatus
      relationStatus:(NSString*)relationStatus { 
     self.appCode = appCode;               
     self.serviceCode = serviceCode;               
     self.region = region;               
     self.resourceIds = resourceIds;               
     self.renewStatus = renewStatus;               
     self.relationStatus = relationStatus;               
    return self;
}

-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self appCode])
    {
        [result setValue:[self appCode] forKey:@"appCode"];
    }
    if([self serviceCode])
    {
        [result setValue:[self serviceCode] forKey:@"serviceCode"];
    }
    if([self region])
    {
        [result setValue:[self region] forKey:@"region"];
    }
    if([self resourceIds])
    {
        [result setValue:[self resourceIds] forKey:@"resourceIds"];
    }
    if([self renewStatus])
    {
        [result setValue:[self renewStatus] forKey:@"renewStatus"];
    }
    if([self relationStatus])
    {
        [result setValue:[self relationStatus] forKey:@"relationStatus"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.appCode = [dictionary objectForKey:@"appCode"];
    self.serviceCode = [dictionary objectForKey:@"serviceCode"];
    self.region = [dictionary objectForKey:@"region"];
    self.resourceIds = [dictionary objectForKey:@"resourceIds"];
    self.renewStatus = [dictionary objectForKey:@"renewStatus"];
    self.relationStatus = [dictionary objectForKey:@"relationStatus"];
    return self;
}
 @end
@implementation QueryExpiredResourceParam
-(id) initWithRegion:(NSString*) region
      serviceCodes:(NSString*)serviceCodes
      expireType:(NSNumber*)expireType
      pageIndex:(NSNumber*)pageIndex
      pageSize:(NSNumber*)pageSize { 
     self.region = region;               
     self.serviceCodes = serviceCodes;               
     self.expireType = expireType;               
     self.pageIndex = pageIndex;               
     self.pageSize = pageSize;               
    return self;
}

-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self region])
    {
        [result setValue:[self region] forKey:@"region"];
    }
    if([self serviceCodes])
    {
        [result setValue:[self serviceCodes] forKey:@"serviceCodes"];
    }
    if([self expireType])
    {
        [result setValue:[self expireType] forKey:@"expireType"];
    }
    if([self pageIndex])
    {
        [result setValue:[self pageIndex] forKey:@"pageIndex"];
    }
    if([self pageSize])
    {
        [result setValue:[self pageSize] forKey:@"pageSize"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.region = [dictionary objectForKey:@"region"];
    self.serviceCodes = [dictionary objectForKey:@"serviceCodes"];
    self.expireType = [dictionary objectForKey:@"expireType"];
    self.pageIndex = [dictionary objectForKey:@"pageIndex"];
    self.pageSize = [dictionary objectForKey:@"pageSize"];
    return self;
}
 @end
@implementation QueryExpiredResourceResultVo
-(id) initWithResourceId:(NSString*) resourceId
      resourceName:(NSString*)resourceName
      serviceCode:(NSString*)serviceCode
      appCode:(NSString*)appCode
      expiredDays:(NSNumber*)expiredDays
      regionId:(NSString*)regionId
      billingType:(NSNumber*)billingType { 
     self.resourceId = resourceId;               
     self.resourceName = resourceName;               
     self.serviceCode = serviceCode;               
     self.appCode = appCode;               
     self.expiredDays = expiredDays;               
     self.regionId = regionId;               
     self.billingType = billingType;               
    return self;
}

-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self resourceId])
    {
        [result setValue:[self resourceId] forKey:@"resourceId"];
    }
    if([self resourceName])
    {
        [result setValue:[self resourceName] forKey:@"resourceName"];
    }
    if([self serviceCode])
    {
        [result setValue:[self serviceCode] forKey:@"serviceCode"];
    }
    if([self appCode])
    {
        [result setValue:[self appCode] forKey:@"appCode"];
    }
    if([self expiredDays])
    {
        [result setValue:[self expiredDays] forKey:@"expiredDays"];
    }
    if([self regionId])
    {
        [result setValue:[self regionId] forKey:@"regionId"];
    }
    if([self billingType])
    {
        [result setValue:[self billingType] forKey:@"billingType"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.resourceId = [dictionary objectForKey:@"resourceId"];
    self.resourceName = [dictionary objectForKey:@"resourceName"];
    self.serviceCode = [dictionary objectForKey:@"serviceCode"];
    self.appCode = [dictionary objectForKey:@"appCode"];
    self.expiredDays = [dictionary objectForKey:@"expiredDays"];
    self.regionId = [dictionary objectForKey:@"regionId"];
    self.billingType = [dictionary objectForKey:@"billingType"];
    return self;
}
 @end
@implementation SetRenewalParam
-(id) initWithAppCode:(NSString*) appCode
      serviceCode:(NSString*)serviceCode
      timeSpan:(NSNumber*)timeSpan
      timeUnit:(NSString*)timeUnit
      instanceIds:(NSString*)instanceIds
      autoRenewStatus:(NSString*)autoRenewStatus
      allAutoPay:(NSString*)allAutoPay { 
     self.appCode = appCode;               
     self.serviceCode = serviceCode;               
     self.timeSpan = timeSpan;               
     self.timeUnit = timeUnit;               
     self.instanceIds = instanceIds;               
     self.autoRenewStatus = autoRenewStatus;               
     self.allAutoPay = allAutoPay;               
    return self;
}

-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self appCode])
    {
        [result setValue:[self appCode] forKey:@"appCode"];
    }
    if([self serviceCode])
    {
        [result setValue:[self serviceCode] forKey:@"serviceCode"];
    }
    if([self timeSpan])
    {
        [result setValue:[self timeSpan] forKey:@"timeSpan"];
    }
    if([self timeUnit])
    {
        [result setValue:[self timeUnit] forKey:@"timeUnit"];
    }
    if([self instanceIds])
    {
        [result setValue:[self instanceIds] forKey:@"instanceIds"];
    }
    if([self autoRenewStatus])
    {
        [result setValue:[self autoRenewStatus] forKey:@"autoRenewStatus"];
    }
    if([self allAutoPay])
    {
        [result setValue:[self allAutoPay] forKey:@"allAutoPay"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.appCode = [dictionary objectForKey:@"appCode"];
    self.serviceCode = [dictionary objectForKey:@"serviceCode"];
    self.timeSpan = [dictionary objectForKey:@"timeSpan"];
    self.timeUnit = [dictionary objectForKey:@"timeUnit"];
    self.instanceIds = [dictionary objectForKey:@"instanceIds"];
    self.autoRenewStatus = [dictionary objectForKey:@"autoRenewStatus"];
    self.allAutoPay = [dictionary objectForKey:@"allAutoPay"];
    return self;
}
 @end
@implementation RenewInstanceParam
-(id) initWithAppCode:(NSString*) appCode
      serviceCode:(NSString*)serviceCode
      timeSpan:(NSNumber*)timeSpan
      timeUnit:(NSString*)timeUnit
      instanceIds:(NSString*)instanceIds
      unifyDate:(NSString*)unifyDate
      autoPay:(NSNumber*)autoPay
      returnURL:(NSString*)returnURL { 
     self.appCode = appCode;               
     self.serviceCode = serviceCode;               
     self.timeSpan = timeSpan;               
     self.timeUnit = timeUnit;               
     self.instanceIds = instanceIds;               
     self.unifyDate = unifyDate;               
     self.autoPay = autoPay;               
     self.returnURL = returnURL;               
    return self;
}

-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self appCode])
    {
        [result setValue:[self appCode] forKey:@"appCode"];
    }
    if([self serviceCode])
    {
        [result setValue:[self serviceCode] forKey:@"serviceCode"];
    }
    if([self timeSpan])
    {
        [result setValue:[self timeSpan] forKey:@"timeSpan"];
    }
    if([self timeUnit])
    {
        [result setValue:[self timeUnit] forKey:@"timeUnit"];
    }
    if([self instanceIds])
    {
        [result setValue:[self instanceIds] forKey:@"instanceIds"];
    }
    if([self unifyDate])
    {
        [result setValue:[self unifyDate] forKey:@"unifyDate"];
    }
    if([self autoPay])
    {
        [result setValue:[self autoPay] forKey:@"autoPay"];
    }
    if([self returnURL])
    {
        [result setValue:[self returnURL] forKey:@"returnURL"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.appCode = [dictionary objectForKey:@"appCode"];
    self.serviceCode = [dictionary objectForKey:@"serviceCode"];
    self.timeSpan = [dictionary objectForKey:@"timeSpan"];
    self.timeUnit = [dictionary objectForKey:@"timeUnit"];
    self.instanceIds = [dictionary objectForKey:@"instanceIds"];
    self.unifyDate = [dictionary objectForKey:@"unifyDate"];
    self.autoPay = [dictionary objectForKey:@"autoPay"];
    self.returnURL = [dictionary objectForKey:@"returnURL"];
    return self;
}
 @end
@implementation QueryInstanceParam
-(id) initWithAppCode:(NSString*) appCode
      serviceCode:(NSString*)serviceCode
      instanceName:(NSString*)instanceName
      instanceId:(NSString*)instanceId
      renewStatus:(NSString*)renewStatus
      billingType:(NSString*)billingType
      expireType:(NSString*)expireType
      ipAddress:(NSString*)ipAddress
      pageNumber:(NSNumber*)pageNumber
      pageSize:(NSNumber*)pageSize { 
     self.appCode = appCode;               
     self.serviceCode = serviceCode;               
     self.instanceName = instanceName;               
     self.instanceId = instanceId;               
     self.renewStatus = renewStatus;               
     self.billingType = billingType;               
     self.expireType = expireType;               
     self.ipAddress = ipAddress;               
     self.pageNumber = pageNumber;               
     self.pageSize = pageSize;               
    return self;
}

-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self appCode])
    {
        [result setValue:[self appCode] forKey:@"appCode"];
    }
    if([self serviceCode])
    {
        [result setValue:[self serviceCode] forKey:@"serviceCode"];
    }
    if([self instanceName])
    {
        [result setValue:[self instanceName] forKey:@"instanceName"];
    }
    if([self instanceId])
    {
        [result setValue:[self instanceId] forKey:@"instanceId"];
    }
    if([self renewStatus])
    {
        [result setValue:[self renewStatus] forKey:@"renewStatus"];
    }
    if([self billingType])
    {
        [result setValue:[self billingType] forKey:@"billingType"];
    }
    if([self expireType])
    {
        [result setValue:[self expireType] forKey:@"expireType"];
    }
    if([self ipAddress])
    {
        [result setValue:[self ipAddress] forKey:@"ipAddress"];
    }
    if([self pageNumber])
    {
        [result setValue:[self pageNumber] forKey:@"pageNumber"];
    }
    if([self pageSize])
    {
        [result setValue:[self pageSize] forKey:@"pageSize"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.appCode = [dictionary objectForKey:@"appCode"];
    self.serviceCode = [dictionary objectForKey:@"serviceCode"];
    self.instanceName = [dictionary objectForKey:@"instanceName"];
    self.instanceId = [dictionary objectForKey:@"instanceId"];
    self.renewStatus = [dictionary objectForKey:@"renewStatus"];
    self.billingType = [dictionary objectForKey:@"billingType"];
    self.expireType = [dictionary objectForKey:@"expireType"];
    self.ipAddress = [dictionary objectForKey:@"ipAddress"];
    self.pageNumber = [dictionary objectForKey:@"pageNumber"];
    self.pageSize = [dictionary objectForKey:@"pageSize"];
    return self;
}
 @end
@implementation ListQuery
-(id) initWithAppCode:(NSString*) appCode
      serviceCode:(NSString*)serviceCode
      resourceId:(NSString*)resourceId
      resourceName:(NSString*)resourceName
      region:(NSString*)region
      billingType:(NSString*)billingType
      expireTime:(NSString*)expireTime
      lastTime:(NSNumber*)lastTime
      autoRenewStatus:(NSString*)autoRenewStatus
      autoRenewPeriod:(NSString*)autoRenewPeriod
      associateResource:(NSString*)associateResource
      extendField:(NSString*)extendField
      relationList:(NSArray<RelationResource*>*)relationList { 
     self.appCode = appCode;               
     self.serviceCode = serviceCode;               
     self.resourceId = resourceId;               
     self.resourceName = resourceName;               
     self.region = region;               
     self.billingType = billingType;               
     self.expireTime = expireTime;               
     self.lastTime = lastTime;               
     self.autoRenewStatus = autoRenewStatus;               
     self.autoRenewPeriod = autoRenewPeriod;               
     self.associateResource = associateResource;               
     self.extendField = extendField;               
     self.relationList = relationList;               
    return self;
}

-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self appCode])
    {
        [result setValue:[self appCode] forKey:@"appCode"];
    }
    if([self serviceCode])
    {
        [result setValue:[self serviceCode] forKey:@"serviceCode"];
    }
    if([self resourceId])
    {
        [result setValue:[self resourceId] forKey:@"resourceId"];
    }
    if([self resourceName])
    {
        [result setValue:[self resourceName] forKey:@"resourceName"];
    }
    if([self region])
    {
        [result setValue:[self region] forKey:@"region"];
    }
    if([self billingType])
    {
        [result setValue:[self billingType] forKey:@"billingType"];
    }
    if([self expireTime])
    {
        [result setValue:[self expireTime] forKey:@"expireTime"];
    }
    if([self lastTime])
    {
        [result setValue:[self lastTime] forKey:@"lastTime"];
    }
    if([self autoRenewStatus])
    {
        [result setValue:[self autoRenewStatus] forKey:@"autoRenewStatus"];
    }
    if([self autoRenewPeriod])
    {
        [result setValue:[self autoRenewPeriod] forKey:@"autoRenewPeriod"];
    }
    if([self associateResource])
    {
        [result setValue:[self associateResource] forKey:@"associateResource"];
    }
    if([self extendField])
    {
        [result setValue:[self extendField] forKey:@"extendField"];
    }
    if([self relationList])
    {
        NSMutableArray<NSDictionary*>* arrayDic  = [[NSMutableArray alloc] init];
        for (int i =0 ; i< [[self relationList] count]; i++) {
            RelationResource* item = [[self relationList] objectAtIndex:i];
            [arrayDic addObject:[item dictionary]];
        }
        [result setValue:arrayDic forKey:@"relationList"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.appCode = [dictionary objectForKey:@"appCode"];
    self.serviceCode = [dictionary objectForKey:@"serviceCode"];
    self.resourceId = [dictionary objectForKey:@"resourceId"];
    self.resourceName = [dictionary objectForKey:@"resourceName"];
    self.region = [dictionary objectForKey:@"region"];
    self.billingType = [dictionary objectForKey:@"billingType"];
    self.expireTime = [dictionary objectForKey:@"expireTime"];
    self.lastTime = [dictionary objectForKey:@"lastTime"];
    self.autoRenewStatus = [dictionary objectForKey:@"autoRenewStatus"];
    self.autoRenewPeriod = [dictionary objectForKey:@"autoRenewPeriod"];
    self.associateResource = [dictionary objectForKey:@"associateResource"];
    self.extendField = [dictionary objectForKey:@"extendField"];
    NSArray* relationListArray = [dictionary objectForKey:@"relationList"];
    if(relationListArray&&![relationListArray isKindOfClass:[NSNull class]])
    {
        NSMutableArray* propertyArray = [[NSMutableArray alloc]init];
        for(int i = 0 ; i< [relationListArray count];i++)
        {
            RelationResource* item = [[RelationResource alloc]initWithDic:[relationListArray objectAtIndex:i]];
            if(item)
            {
                [propertyArray addObject:item];
            }
        }
        self.relationList = propertyArray;
    }
    return self;
}
 @end
@implementation ResourceMapResult
-(id) initWithServiceCode:(NSString*) serviceCode
      resourceList:(NSArray<QueryExpiredResourceResultVo*>*)resourceList
      totalNumber:(NSNumber*)totalNumber
      resourceIdList:(NSArray<NSString*>*)resourceIdList { 
     self.serviceCode = serviceCode;               
     self.resourceList = resourceList;               
     self.totalNumber = totalNumber;               
     self.resourceIdList = resourceIdList;               
    return self;
}

-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self serviceCode])
    {
        [result setValue:[self serviceCode] forKey:@"serviceCode"];
    }
    if([self resourceList])
    {
        NSMutableArray<NSDictionary*>* arrayDic  = [[NSMutableArray alloc] init];
        for (int i =0 ; i< [[self resourceList] count]; i++) {
            QueryExpiredResourceResultVo* item = [[self resourceList] objectAtIndex:i];
            [arrayDic addObject:[item dictionary]];
        }
        [result setValue:arrayDic forKey:@"resourceList"];
    }
    if([self totalNumber])
    {
        [result setValue:[self totalNumber] forKey:@"totalNumber"];
    }
    if([self resourceIdList])
    {
        [result setValue:[self resourceIdList] forKey:@"resourceIdList"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.serviceCode = [dictionary objectForKey:@"serviceCode"];
    NSArray* resourceListArray = [dictionary objectForKey:@"resourceList"];
    if(resourceListArray&&![resourceListArray isKindOfClass:[NSNull class]])
    {
        NSMutableArray* propertyArray = [[NSMutableArray alloc]init];
        for(int i = 0 ; i< [resourceListArray count];i++)
        {
            QueryExpiredResourceResultVo* item = [[QueryExpiredResourceResultVo alloc]initWithDic:[resourceListArray objectAtIndex:i]];
            if(item)
            {
                [propertyArray addObject:item];
            }
        }
        self.resourceList = propertyArray;
    }
    self.totalNumber = [dictionary objectForKey:@"totalNumber"];
    self.resourceIdList = [dictionary objectForKey:@"resourceIdList"];
    return self;
}
 @end
 
 


